﻿@model CMS.UI.Models.DomainModel
<div class="sectionHeader" data-bind="text: sectionHeader">
</div>
<form id="DomainForm" action="#" method="post" data-bind="submit: onSubmit">
    <div class="sectionWindow">
        <div class="btnToggleSection">
            Domain Settings +</div>
        <div class="sectionContent">
            <div>
                @Html.LabelFor(m => m.DO_Domain)
                @Html.TextBoxFor(m => m.DO_Domain)
                @Html.ValidationMessageFor(m => m.DO_Domain)
                @Html.HiddenFor(m => m.DomainID)
            </div>
            <div>
                @Html.LabelFor(m => m.DO_Email)
                @Html.TextBoxFor(m => m.DO_Email)
            </div>
            <div>
                @Html.LabelFor(m => m.DO_CompanyName)
                @Html.TextBoxFor(m => m.DO_CompanyName)
            </div>
            <div>
                @Html.LabelFor(m => m.DO_CompanyAddress)
                @Html.TextBoxFor(m => m.DO_CompanyAddress, new { @class = "long" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_CompanyTelephone)
                @Html.TextBoxFor(m => m.DO_CompanyTelephone, new { @class = "short" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_HomePageID)
                <select id="DO_HomePageID" name="DO_HomePageID">
                    <option value="0">...</option>
                    @foreach (var item in this.ViewBag.Pages as List<CMS.Utils.Extension.ExtendedSelectListItem>)
                    {
                        <option value="@item.Value" @(item.Selected ? "selected=\"selected\"" : String.Empty)>
                            @while (item.Level-- != 1)
                            { <text>&nbsp;&nbsp;</text> }@item.Text</option>
                    }
                </select>
            </div>
            @*        <div>
            @Html.LabelFor(m => m.DO_DefaultLangID)
            @Html.TextBoxFor(m => m.DO_DefaultLangID, new { @class = "tiny" })
        </div>*@
            <div>
                @Html.LabelFor(m => m.DO_ConsumerSecret)
                @Html.TextBoxFor(m => m.DO_ConsumerSecret, new { @class = "long" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_ConsumerKey)
                @Html.TextBoxFor(m => m.DO_ConsumerKey, new { @class = "long" })
            </div>
            <hr />
            <div>
                @Html.LabelFor(m => m.DO_TwitterToken)
                @Html.TextBoxFor(m => m.DO_TwitterToken, new { @class = "long" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_TwitterSecret)
                @Html.TextBoxFor(m => m.DO_TwitterSecret, new { @class = "long" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_UpdateTwitter)
                @Html.RadioButton("DO_UpdateTwitter", true, Model != null ? Model.DO_UpdateTwitter : false, new { id = "radioTwittYes" })
                @Html.Label("LabelYes", "Yes", new { @for = "radioTwittYes", @class = "checkboxLabel" })
                @Html.RadioButton("DO_UpdateTwitter", false, Model != null ? !Model.DO_UpdateTwitter : true, new { id = "radioTwittNo" })
                @Html.Label("LabelNo", "No", new { @for = "radioTwittNo", @class = "checkboxLabel" })
            </div>
            <hr />
            <div>
                @Html.LabelFor(m => m.DO_GoogleAnalyticsVisible)
                @Html.RadioButton("DO_GoogleAnalyticsVisible", true, Model != null ? Model.DO_GoogleAnalyticsVisible : false, new { id = "radioGoogleYes" })
                @Html.Label("LabelYes", "Yes", new { @for = "radioGoogleYes", @class = "checkboxLabel" })
                @Html.RadioButton("DO_GoogleAnalyticsVisible", false, Model != null ? !Model.DO_GoogleAnalyticsVisible : true, new { id = "radioGoogleNo" })
                @Html.Label("LabelNo", "No", new { @for = "radioGoogleNo", @class = "checkboxLabel" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_GoogleAnalyticsCode)
                @Html.TextAreaFor(m => m.DO_GoogleAnalyticsCode, new { @class = "verylong" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_ShareThis)
                @Html.TextBoxFor(m => m.DO_ShareThis, new { @class = "long" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_LaunchYear)
                @Html.TextBoxFor(m => m.DO_LaunchYear, new { @class = "tiny" })
            </div>
            <div>
                @Html.LabelFor(m => m.DO_CSS)
                @Html.TextBoxFor(m => m.DO_CSS)
            </div>
        </div>
    </div>
        <div class="btnContainer">
            <button type="submit" class="btnGreen" data-bind="visible: isNewDomain">
                Add New Domain</button>
            <button type="submit" class="btnGreen" data-bind="visible: !isNewDomain()">
                Update Domain</button>
            <button type="button" class="btnRed" data-bind="click: onNewDomain">
                Cancel</button>
        </div>
    </div>
</form>
